<div class="panel panel-default">
    <div class="panel-body">
	    <div class="row">
	    	<div class="col-lg-6">
	    		<div class="pull-left">{{('account.settlement.settlementNumber' | translate) || '"结算单号：'}}{{orderId}}</div>
	    	</div>
	    	<div class="col-lg-6">
	            <!-- <div class="pull-right"><em class="fa fa-print"></em>&nbsp;&nbsp;<a (click)="toprint()" style="color:#1AACDA;">打印</a>
	            </div> -->
	    	</div>
	    </div>
	
		<div class="row">
			<div class="col-lg-6">
	    		<h3 class="pull-left">{{left_detail?.chnl_name}}</h3>
	    	</div>
	    	<div class="col-lg-6">
	            <h3 class="pull-right">{{right_detail?.chnl_name}}</h3>
	    	</div>
		</div>
		<div class="row">
			<div class="col-lg-6">
	    		<p class="pull-left">{{left_detail?.area}}</p>
	    	</div>
	    	<div class="col-lg-6">
	            <p class="pull-right">{{right_detail?.area}}</p>
	    	</div>
		</div>
		<div class="row">
			<div class="col-lg-6">
	    		<p class="pull-left">e-mail: {{left_detail?.email}}</p>
	    	</div>
	    	<div class="col-lg-6">
	            <p class="pull-right">e-mail: {{right_detail?.email}}</p>
	    	</div>
		</div>
		<div class="row">
			<div class="col-lg-6">
	    		<p class="pull-left">phone: {{left_detail?.phone}}</p>
	    	</div>
	    	<div class="col-lg-6">
	            <p class="pull-right">phone: {{right_detail?.phone}}</p>
	    	</div>
		</div>
		<div class="row">
			<div class="col-lg-6">
	    		<p class="pull-left">fax: {{left_detail?.fax}}</p>
	    	</div>
	    	<div class="col-lg-6">
	            <p class="pull-right">fax: {{right_detail?.fax}}</p>
	    	</div>
		</div>
		

		
		<div class="row">
			<div class="col-lg-6">
	    		<h4 class="first pull-left" style="color:#46bee9;">{{('account.settlement.settlementDetails' | translate) || '结算单明细'}}</h4>
	    	</div>
	    	<div class="col-lg-6">

	    	</div>
		</div>
		<p-dataTable [value]="detail" sortField="chnl_name" rowGroupMode="subheader" groupField="chnl_name" [sortableRowGroup]="false">
			<p-footer>
                <div style="text-align:right;padding:10px 0;">
                	{{('account.settlement.total' | translate) || '总计：'}}{{('account.settlement.yuan' | translate) || '¥'}}{{count|number:'1.2-2'}}
                </div>
			</p-footer>
		    <ng-template pTemplate="rowgroupheader" let-rowData>{{rowData['chnl_name']}}</ng-template>
		    <p-column field="sale_name" header="{{('account.settlement.saleName' | translate) || '销售'}}" [style]="{'text-align':'center'}"></p-column>
		    <p-column field="order_id" header="{{('account.settlement.orderId' | translate) || '订单'}}" [style]="{'text-align':'center','word-break':'break-all'}"></p-column>
		    <p-column field="create_time" header="{{('account.settlement.createTime' | translate) || '日期'}}" [style]="{'text-align':'center'}"></p-column>
		    <p-column field="prod_name" header="{{('account.settlement.prodName' | translate) || '业务'}}" [style]="{'text-align':'center'}"></p-column>
		    <p-column field="fee" header="{{('account.settlement.fee' | translate) || '金额'}}" [style]="{'text-align':'center'}">
		        <ng-template let-col let-settle="rowData" pTemplate="body">
		            <span style="word-break:break-all;">{{('account.settlement.yuan' | translate) || '¥'}}{{settle[col.field] |number:'1.2-2'}}</span>
		        </ng-template>
		    </p-column>
		    <ng-template pTemplate="rowgroupfooter" let-settle>
		        <td colspan="4" style="text-align:right">{{('account.settlement.subtotal' | translate) || '小计：'}}</td>
		        <td>{{('account.settlement.yuan' | translate) || '¥'}}{{calculateGroupTotal(settle['chnl_name']) |number:'1.2-2'}}</td>
		    </ng-template>
		</p-dataTable>
		<div class="row" style="margin-top:1em;">
			<div class="col-lg-6">

	    	</div>
	    	<div class="col-lg-6">
	            <h4 class="pull-right" style="font-weight:normal;margin-right:1em;">{{('account.settlement.lastMonth' | translate) || '上月调账：'}}{{('account.settlement.yuan' | translate) || '¥'}}{{adjust_fee |number:'1.2-2'}}</h4>
	    	</div>
		</div>
		<div class="row">
			<div class="col-lg-6">

	    	</div>
	    	<div class="col-lg-6">
	            <h4 class="pull-right" style="font-weight:normal;margin-right:1em;">{{('account.settlement.due' | translate) || '应付：'}}{{('account.settlement.yuan' | translate) || '¥'}}{{zong |number:'1.2-2'}}</h4>
	    	</div>
		</div>
	</div>
</div>
<div class="row" style="padding:0 15px;">
	<button style="float:right" class="mb-sm btn btn-primary btn-outline" type="button" (click)="goback()">{{('account.settlement.back' | translate) || '返回'}}</button>
	<button style="float:right" class="mb-sm btn btn-primary btn-outline" type="button" (click)="toprint()">{{('account.settlement.print' | translate) || '打印'}}</button>
</div>